<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>1.下图代码执行后输出的结果是？（选择一项） |  zfy的个人博客</title>
    <meta name="generator" content="VuePress 1.9.7">
    <link rel="icon" href="./img/Scorpio.png">
    <link rel="stylesheet" href="./css/style.css">
    <meta name="description" content="My tech blog">
    
    <link rel="preload" href="./assets/css/0.styles.cfdaa54c.css" as="style"><link rel="preload" href="./assets/js/app.7878252f.js" as="script"><link rel="preload" href="./assets/js/2.877879cc.js" as="script"><link rel="preload" href="./assets/js/94.fec3300c.js" as="script"><link rel="prefetch" href="./assets/js/10.a489e96f.js"><link rel="prefetch" href="./assets/js/11.f6f26a2f.js"><link rel="prefetch" href="./assets/js/12.8a827e29.js"><link rel="prefetch" href="./assets/js/13.e420b04a.js"><link rel="prefetch" href="./assets/js/14.52f00cc6.js"><link rel="prefetch" href="./assets/js/15.ef68d553.js"><link rel="prefetch" href="./assets/js/16.c2999dfd.js"><link rel="prefetch" href="./assets/js/17.0adb748c.js"><link rel="prefetch" href="./assets/js/18.2c077020.js"><link rel="prefetch" href="./assets/js/19.013b5e02.js"><link rel="prefetch" href="./assets/js/20.bb3b854e.js"><link rel="prefetch" href="./assets/js/21.28efc78c.js"><link rel="prefetch" href="./assets/js/22.4a1d71dd.js"><link rel="prefetch" href="./assets/js/23.605a5451.js"><link rel="prefetch" href="./assets/js/24.66bf035d.js"><link rel="prefetch" href="./assets/js/25.fbe72655.js"><link rel="prefetch" href="./assets/js/26.3f374d1f.js"><link rel="prefetch" href="./assets/js/27.556ea617.js"><link rel="prefetch" href="./assets/js/28.0cab868b.js"><link rel="prefetch" href="./assets/js/29.564f8747.js"><link rel="prefetch" href="./assets/js/3.4cfb1b9c.js"><link rel="prefetch" href="./assets/js/30.c4a099d1.js"><link rel="prefetch" href="./assets/js/31.7fbc3d2a.js"><link rel="prefetch" href="./assets/js/32.8f356b20.js"><link rel="prefetch" href="./assets/js/33.b5a1b0bb.js"><link rel="prefetch" href="./assets/js/34.57086c2e.js"><link rel="prefetch" href="./assets/js/35.2b4d0231.js"><link rel="prefetch" href="./assets/js/36.a99f6d64.js"><link rel="prefetch" href="./assets/js/37.eb25dcef.js"><link rel="prefetch" href="./assets/js/38.e45d8594.js"><link rel="prefetch" href="./assets/js/39.213e3a72.js"><link rel="prefetch" href="./assets/js/4.b86a0fbe.js"><link rel="prefetch" href="./assets/js/40.cadafdd6.js"><link rel="prefetch" href="./assets/js/41.23b0f26d.js"><link rel="prefetch" href="./assets/js/42.7c2b83c6.js"><link rel="prefetch" href="./assets/js/43.62f328ea.js"><link rel="prefetch" href="./assets/js/44.c4dfbd34.js"><link rel="prefetch" href="./assets/js/45.cde5bb22.js"><link rel="prefetch" href="./assets/js/46.6c62bdb8.js"><link rel="prefetch" href="./assets/js/47.4857766a.js"><link rel="prefetch" href="./assets/js/48.55a0cccc.js"><link rel="prefetch" href="./assets/js/49.3dceda91.js"><link rel="prefetch" href="./assets/js/5.13776f82.js"><link rel="prefetch" href="./assets/js/50.ab4d52fa.js"><link rel="prefetch" href="./assets/js/51.69ccc35a.js"><link rel="prefetch" href="./assets/js/52.01f3f711.js"><link rel="prefetch" href="./assets/js/53.c146a1ff.js"><link rel="prefetch" href="./assets/js/54.71ce70c2.js"><link rel="prefetch" href="./assets/js/55.98ef481d.js"><link rel="prefetch" href="./assets/js/56.b23daa51.js"><link rel="prefetch" href="./assets/js/57.6aa314ad.js"><link rel="prefetch" href="./assets/js/58.7d6367d9.js"><link rel="prefetch" href="./assets/js/59.88894cf5.js"><link rel="prefetch" href="./assets/js/6.93d89692.js"><link rel="prefetch" href="./assets/js/60.111f9a04.js"><link rel="prefetch" href="./assets/js/61.add82aab.js"><link rel="prefetch" href="./assets/js/62.8bfac830.js"><link rel="prefetch" href="./assets/js/63.db44a5ca.js"><link rel="prefetch" href="./assets/js/64.0244f0ef.js"><link rel="prefetch" href="./assets/js/65.2be994de.js"><link rel="prefetch" href="./assets/js/66.c5066e37.js"><link rel="prefetch" href="./assets/js/67.c11b474b.js"><link rel="prefetch" href="./assets/js/68.276bdc3e.js"><link rel="prefetch" href="./assets/js/69.f5f39d50.js"><link rel="prefetch" href="./assets/js/7.ca9f7e96.js"><link rel="prefetch" href="./assets/js/70.e3ca02b0.js"><link rel="prefetch" href="./assets/js/71.befcf8f7.js"><link rel="prefetch" href="./assets/js/72.04fabafd.js"><link rel="prefetch" href="./assets/js/73.e5b707f2.js"><link rel="prefetch" href="./assets/js/74.b5668150.js"><link rel="prefetch" href="./assets/js/75.eb7cfac9.js"><link rel="prefetch" href="./assets/js/76.c1b76370.js"><link rel="prefetch" href="./assets/js/77.5875e953.js"><link rel="prefetch" href="./assets/js/78.a5e2fa5b.js"><link rel="prefetch" href="./assets/js/79.eb2d51a7.js"><link rel="prefetch" href="./assets/js/8.570c39ea.js"><link rel="prefetch" href="./assets/js/80.7252ac50.js"><link rel="prefetch" href="./assets/js/81.eb980d26.js"><link rel="prefetch" href="./assets/js/82.9e069d8f.js"><link rel="prefetch" href="./assets/js/83.8c5a6dc6.js"><link rel="prefetch" href="./assets/js/84.26baaa09.js"><link rel="prefetch" href="./assets/js/85.96bc7e77.js"><link rel="prefetch" href="./assets/js/86.9c9dd1ca.js"><link rel="prefetch" href="./assets/js/87.d54639b8.js"><link rel="prefetch" href="./assets/js/88.3d3ae1e1.js"><link rel="prefetch" href="./assets/js/89.a81caa83.js"><link rel="prefetch" href="./assets/js/9.7a58df3d.js"><link rel="prefetch" href="./assets/js/90.c3c347ed.js"><link rel="prefetch" href="./assets/js/91.b6240032.js"><link rel="prefetch" href="./assets/js/92.8331718a.js"><link rel="prefetch" href="./assets/js/93.ca174cfa.js"><link rel="prefetch" href="./assets/js/95.076b06fb.js"><link rel="prefetch" href="./assets/js/96.8ed8b32f.js">
    <link rel="stylesheet" href="./assets/css/0.styles.cfdaa54c.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/./" class="home-link router-link-active"><!----> <span class="site-name"> zfy的个人博客</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="http://127.0.0.1:3002/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  自由博客板块
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="http://zfyangelo.gitee.io/yu-weather-web-show/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  天气预报
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/./guide/" class="nav-link router-link-active">
  个人的学习笔记
</a></div><div class="nav-item"><a href="/./baodian/interview/" class="nav-link">
  项目及在校经历
</a></div><div class="nav-item"><a href="/./baodian/talk/" class="nav-link">
  爱好和联系方式
</a></div><div class="nav-item"><a href="https://gitee.com/zfyangelo" target="_blank" rel="noopener noreferrer" class="nav-link external">
  我的gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="http://127.0.0.1:3002/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  自由博客板块
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="http://zfyangelo.gitee.io/yu-weather-web-show/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  天气预报
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><a href="/./guide/" class="nav-link router-link-active">
  个人的学习笔记
</a></div><div class="nav-item"><a href="/./baodian/interview/" class="nav-link">
  项目及在校经历
</a></div><div class="nav-item"><a href="/./baodian/talk/" class="nav-link">
  爱好和联系方式
</a></div><div class="nav-item"><a href="https://gitee.com/zfyangelo" target="_blank" rel="noopener noreferrer" class="nav-link external">
  我的gitee
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>HTML</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>CSS</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Javascipt</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>HTML&amp;CSS练习</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Javascipt练习</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/./guide/notes/jswork/01-认识javascript.html" class="sidebar-link">01-认识javaScript</a></li><li><a href="/./guide/notes/jswork/02-变量与数据类型.html" class="sidebar-link">02-变量与数据类型</a></li><li><a href="/./guide/notes/jswork/03-DOM.html" class="sidebar-link">03-DOM</a></li><li><a href="/./guide/notes/jswork/04-表达式和操作符.html" class="sidebar-link">04-表达式和操作符</a></li><li><a href="/./guide/notes/jswork/05-判断.html" class="sidebar-link">05-判断</a></li><li><a href="/./guide/notes/jswork/06-循环.html" class="sidebar-link">06-循环</a></li><li><section class="sidebar-group collapsable is-sub-group depth-1"><p class="sidebar-heading"><span>07-暂无</span> <span class="arrow right"></span></p> <!----></section></li><li><a href="/./guide/notes/jswork/08-函数.html" class="sidebar-link">08-函数</a></li><li><a href="/./guide/notes/jswork/09-案例.html" class="sidebar-link">09-案例</a></li><li><a href="/./guide/notes/jswork/10-数组.html" class="sidebar-link">10-数组</a></li><li><a href="/./guide/notes/jswork/11-字符串.html" class="sidebar-link">11-字符串</a></li><li><a href="/./guide/notes/jswork/12-DOM.html" class="sidebar-link">12-DOM</a></li><li><a href="/./guide/notes/jswork/13-浏览器操作.html" class="sidebar-link">13-BOM</a></li><li><a href="/./guide/notes/jswork/14-面向project.html" class="sidebar-link">14-面向对象</a></li><li><a href="/./guide/notes/jswork/15-Js阶段测试组卷.html" class="sidebar-link">15-Js阶段测试组卷</a></li><li><a href="/./guide/notes/jswork/16-模板字符串箭头函数变量声明.html" class="sidebar-link">16-模板字符串箭头函数变量声明</a></li><li><a href="/./guide/notes/jswork/17-解构赋值.html" class="sidebar-link">17-解构赋值</a></li><li><a href="/./guide/notes/jswork/18-project字面量增强和函数默认参数.html" class="sidebar-link">18-对象字面量增强和函数默认参数</a></li><li><a href="/./guide/notes/jswork/19-剩余参数和数组展开.html" class="sidebar-link">19-剩余参数和数组展开</a></li><li><a href="/./guide/notes/jswork/20-Map Set.html" class="sidebar-link">20-Map Set</a></li><li><a href="/./guide/notes/jswork/21-iterator和for...of循环.html" class="sidebar-link">21-iterator和for...of循环</a></li><li><a href="/./guide/notes/jswork/22-Promise和class.html" class="sidebar-link">22-Promise和class</a></li><li><a href="/./guide/notes/jswork/23-module.html" class="sidebar-link">23-module</a></li><li><a href="/./guide/notes/jswork/24-ES6测评题目.html" class="active sidebar-link">24-ES6测评题目</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/./guide/notes/jswork/25-本地存储和http.html" class="sidebar-link">25-本地存储和http</a></li><li><a href="/./guide/notes/jswork/26-ajax选择题.html" class="sidebar-link">26-ajax选择题</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h3 id="_1-下图代码执行后输出的结果是-选择一项"><a href="#_1-下图代码执行后输出的结果是-选择一项" class="header-anchor">#</a> 1.下图代码执行后输出的结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/DIx1II" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DIx1II.png" alt="DIx1II.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**2</p> <p>**B.**NaN</p> <p>**C.**4</p> <p>**D.**报错</p> <p><strong>参考解析：</strong></p> <p>本题主要考查箭头函数和解构赋值的综合应用。</p> <p>arguments是普通函数中保存所有参数的一个类数组，但箭头函数中没有arguments，所以本题代码中，箭头函数f中的arguments指代的是普通函数foo中的arguments，通过数组解构赋值获取里面的值，即：arg1=2，那么最终返回的结果为4，<strong>所以本题答案为C</strong></p> <h3 id="_2-下图代码执行后输出的结果是-选择一项"><a href="#_2-下图代码执行后输出的结果是-选择一项" class="header-anchor">#</a> 2,下图代码执行后输出的结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/DIxRL4" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DIxRL4.png" alt="DIxRL4.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**1 2 3</p> <p>**B.**2 1 0</p> <p>**C.**undefined 1 undefined</p> <p>**D.**0 1 2</p> <p><strong>本题主要考查参数默认值和对象解构赋值的综合应用。</strong></p> <p>对象的解构赋值不会受到属性的排列次序影响，本题代码中针对传递的参数进行对象解构，属性名对应的值与位置无关，所以x值为0， y值为1，z值为2**，本题答案为D。**</p> <h3 id="_3-下列代码执行结果是-选择一项"><a href="#_3-下列代码执行结果是-选择一项" class="header-anchor">#</a> 3.下列代码执行结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/DIxbQO" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DIxbQO.png" alt="DIxbQO.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**imooc 4</p> <p>**B.**imooc 5</p> <p>**C.**undefined 5</p> <p>**D.**undefined 4</p> <p>本题主要考查对Set和Map的理解。</p> <p>1、Map是一个键值对的集合，键名可以任意类型。</p> <p>本题代码中创建的map对象，使用set方法使用的数组[1]和get方法中使用的数组[1]，分别是不同的数组，只不过它们元素都是1而已，map.get([1])返回的结果是undefined。</p> <p>2、Set是一个不会添加重复值的数据集合。</p> <p>NaN与任何数据比较时默认都是不相等的，但有一个特殊情况，Set在添加数据时，默认两个NaN是相等的。本题代码的数组中第二个位置和最后一个位置的NaN属于重复值，只会添加一个；</p> <p>第五个位置的&quot;NaN&quot;添加了引号，属于字符串，与其他两个位置的NaN不同，会添加到集合中。数值1重复了，只会添加一个值。</p> <p>最终添加到Set集合中的值为1，NaN，2，&quot;NaN&quot;，set.size的值为4，</p> <p><strong>所以最终打印结果是undefined 4，本题答案为D.</strong></p> <h3 id="_4-下列选项中-不可以使用for-of循环的是-选择一项"><a href="#_4-下列选项中-不可以使用for-of循环的是-选择一项" class="header-anchor">#</a> 4.下列选项中，不可以使用for…of循环的是？（选择一项）</h3> <p>**A.**let arr = ['y', 'u', 'n', 'm', 'u']</p> <p>**B.**let obj = {name: &quot;xm&quot;, age: 18}</p> <p>**C.**let str = 'yunmudsb'</p> <p>**D.**let list = document.querySelectorAll('li')</p> <p>参考解析：</p> <p><strong>本题主要考查for…of方法。</strong></p> <p>for...of循环可以使用的范围包括数组、Set 和 Map 结构、arguments对象，NodeList对象、以及字符串等。但是对于普通的对象（使用字面量和构造函数Object声明的对象），不能直接使用for...of遍历，会出现报错，所以一般会使用for…in方法循环普通对象。</p> <p>A选项数组，C选项字符串、D选项NodeList对象，都可使用for…of循环。B选项是普通的对象，无法使用for…of循环，<strong>所以本题答案为B.</strong></p> <h3 id="_5-关于promise对象的状态-下列描述错误的是-选择一项"><a href="#_5-关于promise对象的状态-下列描述错误的是-选择一项" class="header-anchor">#</a> 5.关于promise对象的状态，下列描述错误的是？（选择一项）</h3> <p>**A.**pending初始状态可以变成fulfilled成功状态</p> <p>**B.**pending初始状态可以变成rejected失败状态</p> <p>**C.**rejected失败状态可以变成fulfilled成功状态</p> <p>**D.**fulfilled成功状态不可以变成rejected失败状态</p> <p><strong>本题主要考查promise对象的状态。</strong></p> <p>promise对象一共有三种状态：pending（进行中）、fulfilled（已成功）和rejected（已失败）。</p> <p>promise对象的状态改变，只有两种可能：（1）从pending变为fulfilled；（2）从pending变为rejected，AB选项正确。</p> <p>状态一旦改变，就不会再改变了，rejected失败状态不可能再改变为fulfilled成功状态，C选项错误，D选项正确。</p> <p><strong>所以本题答案为C.</strong></p> <h3 id="_6-下图所示代码-运行结果是-选择一项"><a href="#_6-下图所示代码-运行结果是-选择一项" class="header-anchor">#</a> 6.下图所示代码，运行结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/DIzlXF" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DIzlXF.png" alt="DIzlXF.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**3 err</p> <p>**B.**2 err</p> <p>**C.**3</p> <p>**D.**2</p> <p><strong>本题主要考查Promise对象的catch方法。</strong></p> <p>catch方法用来捕捉前面抛出的错误，对错误进行处理，catch之后可以继续使用链式操作。当错误已经别捕捉到了，就不会再执行后续的catch方法了。</p> <p>本题代码中第一个catch方法捕获到了错误之后，可以继续链式调用，返回的结果1作为传入下一个then方法的参数， 执行x+1后，将结果2返回作为传递给下一个then方法的参数，所以输出结果是2。</p> <p>虽然第一个catch方法内部没有对错误进行处理，但已经捕获过错误了，那么后续的catch方法不会再执行了，最后一个catch方法不会输出任何信息。</p> <p><strong>所以代码最终输出结果为2，本题答案为D.</strong></p> <h3 id="_7-下图所示代码中-函数fn内部返回了一个promise实例对象-如果要实现下图中的输出结果-并且是每隔一秒输出一次数值1-选项中代码书写正确的是-选择一项"><a href="#_7-下图所示代码中-函数fn内部返回了一个promise实例对象-如果要实现下图中的输出结果-并且是每隔一秒输出一次数值1-选项中代码书写正确的是-选择一项" class="header-anchor">#</a> 7.下图所示代码中，函数fn内部返回了一个Promise实例对象，如果要实现下图中的输出结果，并且是每隔一秒输出一次数值1，选项中代码书写正确的是？（选择一项）</h3> <p><a href="https://imgchr.com/i/DIzw6O" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DIzw6O.png" alt="DIzw6O.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong><a href="https://imgchr.com/i/DIz6AA" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DIz6AA.png" alt="DIz6AA.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>B.</strong><a href="https://imgchr.com/i/DIzght" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DIzght.png" alt="DIzght.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>C.</strong><a href="https://imgchr.com/i/DoSSHJ" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DoSSHJ.png" alt="DoSSHJ.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>D.</strong><a href="https://imgchr.com/i/DoStbQ" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DoStbQ.png" alt="DoStbQ.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>本题主要考查对Promise对象的理解与应用。</strong></p> <p>AC选项代码中，由于then方法中回调函数的内部没有设置return值，导致下一个then方法中的data数据undefined，不符合要求输出数值1的要求。</p> <p>B选项代码中直接返回return data，默认会将数字1转换为成功状态的promise对象，直接就调用下一个then方法，输出数值1，不符合每隔一秒的要求。</p> <p>D选项的代码中返回的是fn()执行之后的promise对象，这个promise对象内部使用了定时器一秒之后才会执行resolve(1)代码，从而实现每隔一秒输出一次数值1。</p> <p><strong>所以本题答案为D.</strong></p> <h3 id="_8-下列所示代码-运行结果是-选择一项"><a href="#_8-下列所示代码-运行结果是-选择一项" class="header-anchor">#</a> 8.下列所示代码，运行结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/DoSRa9" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DoSRa9.png" alt="DoSRa9.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**17</p> <p>**B.**18</p> <p>**C.**19</p> <p>**D.**20</p> <p><strong>本题主要考查class的属性。</strong></p> <p>1、在class中直接声明的属性，以及constructor构造函数中声明的属性都是挂载到实例对象上的，但是counstructor中会覆盖class中直接声明的同名属性值。</p> <p>2、使用static关键字声明的属性是挂载到class类上的，实例对象无法访问。</p> <p>本题代码中Person的实例化对象p1时设置实例属性age值为20 ，之后调用say方法，输出的值20，<strong>所以本题答案为D.</strong></p> <h3 id="_9-下列代码中-书写格式正确的选项是-选择两项"><a href="#_9-下列代码中-书写格式正确的选项是-选择两项" class="header-anchor">#</a> 9.下列代码中，书写格式正确的选项是？（选择两项）</h3> <p><strong>A.</strong><a href="https://imgchr.com/i/DoSHqe" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DoSHqe.png" alt="DoSHqe.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>B.</strong><a href="https://imgchr.com/i/DoppM8" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DoppM8.png" alt="DoppM8.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>C.</strong><a href="https://imgchr.com/i/Dop9sS" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/Dop9sS.png" alt="Dop9sS.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>D.</strong><a href="https://imgchr.com/i/DopiZQ" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DopiZQ.png" alt="DopiZQ.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>本题主要考查Module的导入和导出。</strong></p> <p>1、export default表示单个导出，在导出时，不需要添加{}，对应的使用import导入是，也不需要添加{}，直接书写变量名即可。</p> <p>2、export 表示多个导出。在导出时，需要添加{}， 对应的使用import导入时，也需要添加{}。</p> <p>单个导出，可以直接导出一个值，A选项正确。</p> <p>多个导出时，必须添加{}，代码中的export m没有添加{}，B选项错误。</p> <p>export default属于单个导出，一个模块中只能使用一次，代码中同时使用了两次expaort default语句，C选项错误。</p> <p>*表示整体导入，也就是将所有的都导入，可以整体设置别名， D选项正确。</p> <p><strong>所以本题答案为AD.</strong></p> <h3 id="_10-下图代码运行结果是-选择一项"><a href="#_10-下图代码运行结果是-选择一项" class="header-anchor">#</a> 10.下图代码运行结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/DopKLF" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DopKLF.png" alt="DopKLF.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**0</p> <p>**B.**1</p> <p>**C.**3</p> <p>**D.**报错</p> <p>本题主要考查扩展运算符。</p> <p>本题代码中，从里到外进行展开，[...'...']使用扩展运算符将字符串展开为数组元素，结果为['.','.','.']， 那么[…[...'...']]相等于[…['.','.','.']]，将数组展开到另一个数组中，最终的结果为['.','.','.']，所以数组的长度为3，本题答案为C。</p> <h3 id="_11-下图所示代码-运行后输出结果是-选择一项"><a href="#_11-下图所示代码-运行后输出结果是-选择一项" class="header-anchor">#</a> 11.下图所示代码，运行后输出结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/DoprFA" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DoprFA.png" alt="DoprFA.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**0</p> <p>**B.**1</p> <p>**C.**3</p> <p>**D.**报错</p> <p><strong>本题主要考查箭头函数的this指向。</strong></p> <p>箭头函数没有自己的this，会沿着当前作用域向上查找this,而普通函数的this指向函数的调用对象。</p> <p>本题代码中将调用foo函数的返回结果(即：obj对象)赋值给result,，result.fn()就相当于obj.fn()，那么普通函数fn内部的this指向了obj，所以setTimeout内的箭头函数中访问this.a,会沿着作用域链向上查找到fn函数内部的this.a(也就是obj.a)，值为2。<strong>所以本题答案为B.</strong></p> <h3 id="_12-使用webpack对项目进行打包-下列说法正确的是-选择两项"><a href="#_12-使用webpack对项目进行打包-下列说法正确的是-选择两项" class="header-anchor">#</a> 12.使用webpack对项目进行打包，下列说法正确的是？（选择两项）</h3> <p>**A.**webpack可以自定义同时配置多入口和多出口文件</p> <p>**B.**html、css以及js中的图片可以使用file-loader处理</p> <p>**C.**在js中使用require方式引入的css文件可以使用css-loader转换</p> <p>**D.**html-webpack-plugin插件只能创建一个html入口文件</p> <p><strong>本题主要考查webpack。</strong></p> <p>webpack可以配置单入口和单出口文件，也可以配置多入口和多出口文件。A选项正确。</p> <p>file-loader只能处理css和js文件中图片，不可以处理html中的图片，B选项错误。</p> <p>css-loader支持js中使用require方式引入css文件。C选项正确。</p> <p>html-webpack-plugin插件可以创建html入口文件，并不是只能创建一个html入口文件，例如：单页面可以生成一个html文件入口，配置N个html-webpack-plugin可以生成N个页面入口。 D选项错误。</p> <p><strong>所以本题答案为AC.</strong></p> <h3 id="_13-根据如下代码-下列说法错误的是-选择两项"><a href="#_13-根据如下代码-下列说法错误的是-选择两项" class="header-anchor">#</a> 13.根据如下代码，下列说法错误的是？（选择两项）</h3> <p><a href="https://imgchr.com/i/Do9ghR" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/Do9ghR.png" alt="Do9ghR.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>**A.**第一次输出a的值为2，第二次输出a的值也为2</p> <p>**B.**第一次输出a的值为2，第二次输出a的值为1</p> <p>**C.**第一次输出b的值为2，第二次输出b的值也为2</p> <p>**D.**第一次输出b的值为1，第二次输出b的值为2</p> <p><strong>本题主要考查let关键字和块级作用域。</strong></p> <p>let变量只在{}作用域内有效，var声明的变量不受{}作用域的影响。本题代码按着从上到下的执行顺序，输出结果如下：</p> <p>第一次输出a的值为2，第二次输出a的值为1，A选项说法错误，B选项说法正确。</p> <p>第一次输出b的值为2，第二次输出b的值也为2， C选项说法正确，D选项说法错误。</p> <p><strong>所以本题答案为AD.</strong></p> <h3 id="_14-下列关于常量与变量说法错误的是-选择两项"><a href="#_14-下列关于常量与变量说法错误的是-选择两项" class="header-anchor">#</a> 14.下列关于常量与变量说法错误的是？（选择两项）</h3> <p>**A.**变量是可以改变的</p> <p>**B.**常量声明必须赋值</p> <p>**C.**变量声明必须赋值</p> <p>**D.**常量可以重复声明</p> <p><strong>本题主要考查常量和变量的概念。</strong></p> <p>变量是可以改变的，A选项说法正确。</p> <p>常量声明必须赋值，但是不能重复声明，B选项说法正确，C选项说法错误。</p> <p>变量声明时可以赋值，也可以不赋值，D选项说法错误。</p> <p><strong>所以本题答案为CD.</strong></p> <h3 id="_15-观察如下代码-最后输出的结果是-选择一项"><a href="#_15-观察如下代码-最后输出的结果是-选择一项" class="header-anchor">#</a> 15.观察如下代码，最后输出的结果是？（选择一项）</h3> <p><a href="https://imgchr.com/i/Do9jjf" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/Do9jjf.png" alt="Do9jjf.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong> [2 2]</p> <p><strong>B.</strong>[y 2]</p> <p>**C.**报错</p> <p><strong>D.</strong>[x y]</p> <p><strong>本题主要考查函数参数的默认值。</strong></p> <p>因为参数x默认值等于另一个参数y，而此时y还没有声明，属于&quot;死区&quot;，因此会报错。<strong>所以本题答案为C.</strong></p> <h3 id="_16-如下图-是需要匹配的数组-下列哪个选项不能匹配到-f-选择一项"><a href="#_16-如下图-是需要匹配的数组-下列哪个选项不能匹配到-f-选择一项" class="header-anchor">#</a> 16.如下图，是需要匹配的数组，下列哪个选项不能匹配到'f'？（选择一项）</h3> <p><a href="https://imgchr.com/i/DoiQ6x" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DoiQ6x.png" alt="DoiQ6x.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">let</span> <span class="token punctuation">[</span> <span class="token punctuation">,</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span> <span class="token punctuation">,</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span> <span class="token punctuation">,</span> f <span class="token punctuation">,</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token operator">=</span>arr<span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>B.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">let</span> <span class="token punctuation">[</span><span class="token punctuation">,</span><span class="token punctuation">,</span><span class="token punctuation">[</span><span class="token punctuation">,</span>f<span class="token punctuation">]</span><span class="token punctuation">]</span> <span class="token operator">=</span> <span class="token punctuation">[</span> <span class="token string">'c'</span><span class="token punctuation">,</span> <span class="token string">'d'</span><span class="token punctuation">,</span> <span class="token punctuation">[</span> <span class="token string">'e'</span><span class="token punctuation">,</span> <span class="token string">'f'</span><span class="token punctuation">,</span><span class="token string">'g'</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>C.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">let</span> <span class="token punctuation">[</span><span class="token punctuation">,</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">,</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">,</span> f<span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token punctuation">]</span> <span class="token operator">=</span> arr<span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>D.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">let</span> <span class="token punctuation">[</span> <span class="token punctuation">,</span> <span class="token punctuation">,</span><span class="token punctuation">[</span> <span class="token punctuation">,</span> f <span class="token punctuation">,</span><span class="token punctuation">]</span><span class="token punctuation">]</span><span class="token operator">=</span> arr<span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>本题主要考查数组解构赋值。</strong></p> <p>数组解构赋值，两边的规则需要是一样的，let [ , ,[ , f ,]]= arr; 匹配到的是d，<strong>所以本题答案为D</strong></p> <h3 id="_17-根据如下代码-哪项可以匹配到-前端进阶-响应式开发与常用框架-与-h5-js进阶与组件化网页开发-选择一项"><a href="#_17-根据如下代码-哪项可以匹配到-前端进阶-响应式开发与常用框架-与-h5-js进阶与组件化网页开发-选择一项" class="header-anchor">#</a> 17.根据如下代码，哪项可以匹配到“前端进阶：响应式开发与常用框架”与“H5&amp;JS进阶与组件化网页开发？（选择一项）</h3> <p><a href="https://imgchr.com/i/Dok9s0" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/Dok9s0.png" alt="Dok9s0.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code> <span class="token keyword">const</span> <span class="token punctuation">{</span> <span class="token literal-property property">Course</span><span class="token operator">:</span><span class="token punctuation">[</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>CourseName<span class="token punctuation">}</span><span class="token punctuation">]</span> <span class="token punctuation">,</span> <span class="token punctuation">{</span><span class="token literal-property property">CourseName</span> <span class="token operator">:</span>Name<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">}</span><span class="token operator">=</span> player<span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>B.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">const</span><span class="token punctuation">{</span> <span class="token literal-property property">Course</span><span class="token operator">:</span><span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token punctuation">{</span>CourseName<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token literal-property property">CourseName</span><span class="token operator">:</span>Name<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">}</span> <span class="token operator">=</span> player<span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>C.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">const</span> <span class="token punctuation">{</span> <span class="token literal-property property">Course</span><span class="token operator">:</span><span class="token punctuation">[</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>CourseName<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">{</span>courseName<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">}</span> <span class="token operator">=</span> player<span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>D.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">const</span> <span class="token punctuation">{</span> <span class="token punctuation">,</span> <span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">,</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>CourseName<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">,</span><span class="token punctuation">{</span><span class="token literal-property property">CourseName</span><span class="token operator">:</span>Name<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">}</span> <span class="token operator">=</span> player<span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>本题主要考察对象与数组解构赋值的综合应用。</strong></p> <p>对象的解构赋值中，变量名与属性名必须一致，数组要注意顺序，另外，还要与原数组结构一致</p> <p><strong>所以本题答案为A.</strong></p> <h3 id="_18-观察代码-下列输出结果正确的是-选择一项"><a href="#_18-观察代码-下列输出结果正确的是-选择一项" class="header-anchor">#</a> 18.观察代码，下列输出结果正确的是？（选择一项）</h3> <p><a href="https://imgchr.com/i/DokBTS" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DokBTS.png" alt="DokBTS.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong> { b: 'hello', d: 'e' }</p> <p><strong>B.</strong>{ a: { b: 'c', d: 'e' } }</p> <p><strong>C.</strong>{ a: { b: 'hello', d: 'e' } }</p> <p><strong>D.</strong>{ a: { b: 'hello' } }</p> <p><strong>本题主要对象的新增方法Object.assign方法</strong></p> <p>本题代码中，target对象的a属性被source对象的a属性整个替换掉了，所以是{ a: { b: 'hello' } }；<strong>本题答案为D.</strong></p> <h3 id="_19-学习了类表达式-使用类的表达式的方式书写如下代码-哪一项不能正确输出-云牧最帅-选择两项"><a href="#_19-学习了类表达式-使用类的表达式的方式书写如下代码-哪一项不能正确输出-云牧最帅-选择两项" class="header-anchor">#</a> 19.学习了类表达式，使用类的表达式的方式书写如下代码，哪一项不能正确输出“云牧最帅”?（选择两项）</h3> <p><strong>A.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">let</span> person <span class="token operator">=</span> <span class="token keyword">class</span> <span class="token punctuation">{</span>
    <span class="token function">constructor</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">&quot;云牧最帅&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token keyword">new</span> <span class="token class-name">p</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><strong>B.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">let</span> person <span class="token operator">=</span> <span class="token keyword">class</span> <span class="token punctuation">{</span>
    <span class="token function">constructor</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        p<span class="token punctuation">.</span>imo <span class="token operator">=</span> <span class="token string">&quot;云牧最帅&quot;</span><span class="token punctuation">;</span>
        console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>p<span class="token punctuation">.</span>imo<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token keyword">new</span> <span class="token class-name">person</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br><span class="line-number">7</span><br></div></div><p><strong>C.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">let</span> person <span class="token operator">=</span> <span class="token keyword">class</span> <span class="token punctuation">{</span>
    <span class="token function">constructor</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">&quot;云牧最帅&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token keyword">new</span> <span class="token class-name">person</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p><strong>D.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code><span class="token keyword">let</span> person <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token punctuation">(</span><span class="token keyword">class</span> <span class="token punctuation">{</span>
    <span class="token function">constructor</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
        console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span><span class="token string">&quot;云牧最帅 &quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br></div></div><p><strong>本题主要考查class的语法格式。</strong></p> <p>A选项代码中，这个类的名字是person而不是p，p这个名字是无效的，所以通过 new p() 会报错。</p> <p>B选项代码中，p并没有定义却使用了，所以执行p.imo时会报错“ p is not defined”</p> <p>C选项代码中，声明了class，之后实例化，可以正常输出‘云牧最帅’</p> <p>D选项代码中，相当于在声明class后，直接就实例化了，可以正常输出‘云牧最帅’</p> <p><strong>所以本题答案为AB.</strong></p> <h3 id="_20-观察下如下代码-描述正确的选项是-选择两项"><a href="#_20-观察下如下代码-描述正确的选项是-选择两项" class="header-anchor">#</a> 20.观察下如下代码，描述正确的选项是？（选择两项）</h3> <p><a href="https://imgchr.com/i/DoESbV" target="_blank" rel="noopener noreferrer"><img src="https://s3.ax1x.com/2020/12/02/DoESbV.png" alt="DoESbV.png"><span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><strong>A.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>col<span class="token punctuation">.</span>x<span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token operator">===</span><span class="token operator">&gt;</span> 输出js
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>B.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code>col<span class="token punctuation">.</span><span class="token function">eat</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">===</span><span class="token operator">&gt;</span> 输出前端
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>C.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code> console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>col<span class="token punctuation">.</span>x<span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token operator">===</span><span class="token operator">&gt;</span> 输出<span class="token constant">ES6</span>
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>D.</strong></p> <div class="language-js line-numbers-mode"><pre class="language-js"><code>col<span class="token punctuation">.</span><span class="token function">eat</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token operator">===</span><span class="token operator">&gt;</span> 报错
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br></div></div><p><strong>本题主要考查class的继承。</strong></p> <p>属性的值与代码执行顺序有关，后定义的自己的属性，会覆盖住先继承的父类的。本题代码中，col.x输出的值应该是&quot;ES6&quot;，A选项错错误，C选项正确。</p> <p>子类可以继承父类的属性与方法，所以可以调用父类的实例方法，本题代码中col.eat()可以正常调用，弹出“前端”，B选项正确，D选项错误。</p> <p><strong>所以本题答案为BC.</strong></p></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/./guide/notes/jswork/23-module.html" class="prev">
        23-module
      </a></span> <span class="next"><a href="/./guide/notes/jswork/25-本地存储和http.html">
        25-本地存储和http
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"><!----><div class="reco-bgm-panel" data-v-b1d3339e><audio id="bgm" src="https://www.ytmp3.cn/down/75475.mp3" data-v-b1d3339e></audio> <div class="reco-float-box" style="bottom:30px;z-index:999999;display:none;" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><img src="https://p1.music.126.net/qTSIZ27qiFvRoKj-P30BiA==/109951165895951287.jpg?param=200y200" data-v-b1d3339e></div> <div class="reco-bgm-box" style="left:10px;bottom:10px;z-index:999999;" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><div class="reco-bgm-cover" style="background-image:url(https://p1.music.126.net/qTSIZ27qiFvRoKj-P30BiA==/109951165895951287.jpg?param=200y200);" data-v-b1d3339e><div class="mini-operation" style="display:none;" data-v-b1d3339e><i class="reco-bgm reco-bgm-pause" style="display:none;" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-play" style="display:none;" data-v-b1d3339e></i></div> <div class="falut-message" style="display:none;" data-v-b1d3339e>
          播放失败
        </div></div> <div class="reco-bgm-info" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><div class="info-box" data-v-b1d3339e><i class="reco-bgm reco-bgm-music music" data-v-b1d3339e></i>花花公子</div> <div class="info-box" data-v-b1d3339e><i class="reco-bgm reco-bgm-artist" data-v-b1d3339e></i>马思唯/step.jad</div> <div class="reco-bgm-progress" data-v-b1d3339e><div class="progress-bar" data-v-b1d3339e><div class="bar" data-v-b1d3339e></div></div></div> <div class="reco-bgm-operation" data-v-b1d3339e><i class="reco-bgm reco-bgm-last last" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-pause pause" style="display:none;" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-play play" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-next next" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-volume1 volume" data-v-b1d3339e></i> <i class="reco-bgm reco-bgm-mute mute" style="display:none;" data-v-b1d3339e></i> <div class="volume-bar" data-v-b1d3339e><div class="bar" data-v-b1d3339e></div></div></div></div> <div class="reco-bgm-left-box" data-v-b1d3339e data-v-41bcba48 data-v-b1d3339e><i class="reco-bgm reco-bgm-left" data-v-b1d3339e></i></div></div></div></div></div>
    <script src="./assets/js/app.7878252f.js" defer></script><script src="./assets/js/2.877879cc.js" defer></script><script src="./assets/js/94.fec3300c.js" defer></script>
  </body>
</html>
